<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
</head>
<style>
	tr,th,td{
		width: 100px;
		height: 20px;
		line-height: 10px;
		text-align: center;
	}
</style>
<body>
	<table border="1">
		<tr>
			<th>序号</th>
			<th>商品名</th>
			<th>生产厂家</th>
			<th>类型</th>
			<th>价格</th>
			<th>库存</th>
			<th>操作</th>
		</tr>
		<c:forEach  items="${page.data}" var="goods">
			<tr>
				<td>${goods.goodsId}</td>
				<td>${goods.goodsName}</td>
				<td>${goods.goodsFactory}</td>
				<td>${goods.goodsType}</td>
				<td>${goods.goodsPrice}</td>
				<td>${goods.goodsNum}</td>
				<td><a href="delete.do?goodsId=${goods.goodsId}">删除</a></td>
			</tr>
		</c:forEach>
	</table>
	<div class="pageBar">
		<c:if test="${page.hasPrev}">
			<a href="getGoods.do?pageNum=${page.pageNum-1}">上一页</a>
		</c:if>

		<c:forEach  begin="1" end="${page.totalPages}" var="status">
			<a href="getGoods.do?pageNum=${status}">${status}</a>
		</c:forEach>
		<c:if test="${page.hasNext}">
			<a href="getGoods.do?pageNum=${page.pageNum+1}">下一页</a>
		</c:if>
	</div>
</body>
</html>